package serviceModle;

import java.io.File;
import java.util.Observable;
import java.util.Observer;
import java.util.Queue;
import java.util.Scanner;

import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;


public class Service implements Observer/*extends Thread*/{
	
	boolean active;
	Queue<Update> queueUpdate;// = new Queue<Update>(); 
	ServiceData data;
	@Override
	/**
	 * The method get updates from the osListenr abut changes at the dropbox folder.
	 */
	public void update(Observable arg0, Object arg1) {
		
		String event;
		String path;
		
		//Separate the string arg1 to the event and the path.
		Scanner s=new Scanner((String)arg1);
		s.useDelimiter(" ");
		event = s.next();
		path = s.next();
	
		System.out.format("Service =    %s:   %s\n", event, path);
		
		//Create a file from that path.
		File file = new File(path);
		
		//System.out.println("isFile = "+file.isFile());

        
		
		//Document xmlDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(xmlFile); 
		
	}
}
